export const model = {
  id: undefined,
  pid: undefined,
  authorityType: 0,
  authorityName: undefined,
  authorityCode: undefined,
  authorityDesc: undefined,
  uri: undefined,
  actions: undefined,
  useStatus: 0,
  roles: [],
};
export const rules = {
  authorityType: [
    { required: true, message: "请输入类型", trigger: "blur" },
  ],
  authorityName: [
    { required: true, message: "请输入接口名称", trigger: "blur" },
  ],
  authorityCode: [
    { required: true, message: "请输入接口编码", trigger: "blur" },
  ],
  uri: [{ required: true, message: "请输入接口地址", trigger: "blur" }],
  actions: [{ required: true, message: "请输入请求方式", trigger: "blur" }],
  useStatus: [{ required: true, message: "请输入状态", trigger: "blur" }],
};
export const action = [
  { label: "GET", value: "GET" },
  { label: "POST", value: "POST" },
  { label: "PUT", value: "PUT" },
  { label: "DELETE", value: "DELETE" },
];
export const type = [
  { label: "目录", value: 0 },
  { label: "接口", value: 1 },
];
export const columns = [
  {
    title: "序号",
    dataIndex: "id",
    width: 100,
    align: "center",
    customRender: (text, record, index) => {
      return index + 1;
    },
  },
  {
    title: "接口名称",
    dataIndex: "authorityName",
    key: "authorityName",
    width: 120,
    align: "center",
  },
  {
    title: "接口编码",
    dataIndex: "authorityCode",
    key: "authorityCode",
    width: 120,
    align: "center",
  },
  {
    title: "接口地址",
    dataIndex: "uri",
    key: "uri",
    width: 120,
    align: "center",
  },
  {
    title: "请求方式",
    dataIndex: "actions",
    key: "actions",
    width: 120,
    align: "center",
  },
  {
    title: "可访问角色",
    dataIndex: "roles",
    key: "roles",
    width: 200,
    align: "roles",
    scopedSlots: { customRender: "roles" },
  },

  {
    title: "使用状态",
    dataIndex: "useStatus",
    key: "useStatus",
    width: 120,
    align: "center",
    scopedSlots: { customRender: "useStatus" },
  },
  {
    title: "类型",
    dataIndex: "authorityType",
    key: "authorityType",
    width: 120,
    align: "center",
    scopedSlots: { customRender: "authorityType" },
  },
  {
    title: "接口描述",
    dataIndex: "authorityDesc",
    key: "authorityDesc",
    width: 120,
    align: "center",
  },
  {
    title: "更新人",
    dataIndex: "updateBy",
    key: "updateBy",
    width: 80,
    align: "center",
  },
  {
    title: "更新时间",
    dataIndex: "updateTime",
    key: "updateTime",
    width: 120,
    align: "center",
  },
  {
    title: "创建人",
    dataIndex: "createBy",
    key: "createBy",
    width: 80,
    align: "center",
  },
  {
    title: "创建时间",
    dataIndex: "createTime",
    key: "createTime",
    width: 120,
    align: "center",
  },
  {
    title: "操作",
    key: "action",
    width: 150,
    fixed: "right",
    align: "center",
    scopedSlots: { customRender: "action" },
  },
];
